---
title: Image
description: An image element with an optional fallback for loading and error status.
component: true
kobalte:
    link: https://kobalte.dev/docs/core/components/image
    api: https://kobalte.dev/docs/core/components/image#api-reference
---

<ComponentPreview name="image-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
    <TabsTrigger value="cli">CLI</TabsTrigger>
    <TabsTrigger value="manual">Manual</TabsTrigger>
    <TabsIndicator class="bg-primary" />
</TabsList>

<TabsContent value="cli">

```bash
npx shadcn-solid@latest add image
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Install the following dependencies:</Step>

```bash
npm install @kobalte/core
```

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="image" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Usage

```tsx
import { ImageRoot, ImageFallback, ImageImage } from "@/components/ui/image"
```

```tsx
<ImageRoot>
    <ImageImage src="https://github.com/hngngn.png" />
    <ImageFallback>HN</ImageFallback>
</ImageRoot>
```
